package cn.edu.imnu.entry.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName drug
 */
@TableName(value ="drug")
@Data
public class Drug {
    /**
     * 药品信息表id
     */
    @TableId(type = IdType.AUTO)
    private Long drugId;

    /**
     * 药名
     */
    private String drugName;

    /**
     * 药品成分信息
     */
    private String drugInfo;

    /**
     * 药品功能
     */
    private String drugEffect;

    /**
     * 药品图片url
     */
    private String drugImg;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 更新时间
     */
    private Date updatetime;

    /**
     * 发布者
     */
    private String publisher;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Drug other = (Drug) that;
        return (this.getDrugId() == null ? other.getDrugId() == null : this.getDrugId().equals(other.getDrugId()))
            && (this.getDrugName() == null ? other.getDrugName() == null : this.getDrugName().equals(other.getDrugName()))
            && (this.getDrugInfo() == null ? other.getDrugInfo() == null : this.getDrugInfo().equals(other.getDrugInfo()))
            && (this.getDrugEffect() == null ? other.getDrugEffect() == null : this.getDrugEffect().equals(other.getDrugEffect()))
            && (this.getDrugImg() == null ? other.getDrugImg() == null : this.getDrugImg().equals(other.getDrugImg()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getPublisher() == null ? other.getPublisher() == null : this.getPublisher().equals(other.getPublisher()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDrugId() == null) ? 0 : getDrugId().hashCode());
        result = prime * result + ((getDrugName() == null) ? 0 : getDrugName().hashCode());
        result = prime * result + ((getDrugInfo() == null) ? 0 : getDrugInfo().hashCode());
        result = prime * result + ((getDrugEffect() == null) ? 0 : getDrugEffect().hashCode());
        result = prime * result + ((getDrugImg() == null) ? 0 : getDrugImg().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getPublisher() == null) ? 0 : getPublisher().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", drugId=").append(drugId);
        sb.append(", drugName=").append(drugName);
        sb.append(", drugInfo=").append(drugInfo);
        sb.append(", drugEffect=").append(drugEffect);
        sb.append(", drugImg=").append(drugImg);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", publisher=").append(publisher);
        sb.append("]");
        return sb.toString();
    }
}